package cn.iocoder.yudao.module.promotion.redpacket.controller.app;

import cn.iocoder.yudao.framework.business.basic.annotation.AppJsonView;
import cn.iocoder.yudao.framework.business.basic.controller.PageController;
import cn.iocoder.yudao.framework.business.basic.pojo.dto.SimpleQueryDTO;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.redpacket.pojo.vo.RedPacketUsedVO;
import cn.iocoder.yudao.module.promotion.redpacket.service.app.AppRedPacketUsedService;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 前端控制器
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/07/26
 */
@Tag(name = "用户 APP - 用户红包抵扣记录")
@RestController
@RequestMapping("/promotion/red/packet/used")
public class AppRedPacketUsedController implements PageController<RedPacketUsedVO, SimpleQueryDTO> {
    @Resource
    private AppRedPacketUsedService appRedPacketUsedService;

    @JsonView(AppJsonView.class)
    @Override
    public CommonResult<PageResult<RedPacketUsedVO>> getPage(Integer pageNo, Integer pageSize, SimpleQueryDTO param) {
        return CommonResult.success(appRedPacketUsedService.getPage(pageNo, pageSize, param, getLoginUserId()));
    }

}
